package com.weiling.service.impl;

import com.weiling.entity.User;
import com.weiling.mapper.UserMapper;
import com.weiling.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> selectAllUser() {
        return userMapper.selectAllUser();
    }

    @Override
    public User selectUserById(Integer id) {
        return userMapper.selectUserById(id);
    }

    @Override
    public boolean saveUser(User user) {
        return userMapper.saveUser(user) > 0;
    }

    @Override
    public boolean deleteUserById(int id) {
        return userMapper.deleteUserById(id) > 0;
    }

    @Override
    public boolean updateUser(User user) {
        return userMapper.updateUser(user) > 0;
    }
}
